/**
 * 
 */
package ee.ut.battleship;

import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.ArrayBlockingQueue;
import java.util.concurrent.BlockingQueue;

/**
 * @author Marko & Priit
 *
 */
public class Client {
	private String username;
	private List<Ship> shiplist;
	private List<String> missList = new ArrayList<String>();
	private Client opponent;
	private int playerTurn = -1;
	private BlockingQueue<String> shotList = new ArrayBlockingQueue<String>(2);
	private BlockingQueue<String> updateLobbyList = new ArrayBlockingQueue<String>(100);
	private BlockingQueue<String> joinGameList = new ArrayBlockingQueue<String>(100);
	private BlockingQueue<String> updateHighscoreList = new ArrayBlockingQueue<String>(100);
	
	public Client(String username, List<Ship> shiplist){
		this.username = username;
		this.shiplist = shiplist;
	}

	public Client() {
		// TODO Auto-generated constructor stub
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getUsername() {
		return username;
	}

	public void setShiplist(List<Ship> shiplist) {
		this.shiplist = shiplist;
	}

	public List<Ship> getShiplist() {
		return shiplist;
	}

	public Client getOpponent() {
		return opponent;
	}

	public void setOpponent(Client opponent) {
		this.opponent = opponent;
	}

	public void setShotList(BlockingQueue<String> shotList) {
		this.shotList = shotList;
	}

	public BlockingQueue<String> getShotList() {
		return shotList;
	}

	public void setMissList(List<String> missList) {
		this.missList = missList;
	}

	public List<String> getMissList() {
		return missList;
	}
	public void reset() {
		missList = new ArrayList<String>();
		shotList = new ArrayBlockingQueue<String>(2);
		shiplist = new ArrayList<Ship>();
		playerTurn = -1;
		
	}

	public void setUpdateLobbyList(BlockingQueue<String> updateLobbyList) {
		this.updateLobbyList = updateLobbyList;
	}

	public BlockingQueue<String> getUpdateLobbyList() {
		return updateLobbyList;
	}

	public void setJoinGameList(BlockingQueue<String> joinGameList) {
		this.joinGameList = joinGameList;
	}

	public BlockingQueue<String> getJoinGameList() {
		return joinGameList;
	}

	public void setUpdateHighscoreList(BlockingQueue<String> updateHighscoreList) {
		this.updateHighscoreList = updateHighscoreList;
	}

	public BlockingQueue<String> getUpdateHighscoreList() {
		return updateHighscoreList;
	}

	public void setPlayerTurn(int playerTurn) {
		this.playerTurn = playerTurn;
	}

	public int getPlayerTurn() {
		return playerTurn;
	}
	public String toString() {
		return username;
	}

	
}
